<?php
/**
 * @version        $Id: default.php 22359 2011-11-07 16:31:03Z github_bot $
 * @package        Joomla.Site
 * @subpackage    com_content
 * @copyright    Copyright (C) 2005 - 2011 Open Source Matters, Inc. All rights reserved.
 * @license        GNU General Public License version 2 or later; see LICENSE.txt
 */
// no direct access
defined('_JEXEC') or die;
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers');
// Create shortcuts to some parameters.
$params = $this->item->params;
$canEdit = $this->item->params->get('access-edit');
$user = JFactory::getUser();

?>
<div class="item-page<?php echo $this->pageclass_sfx?>">
    <h2>
        <?php echo $this->escape($this->item->title); ?>
    </h2>

    <div class="items-leading">
        <div class="leading-0">
            <div class="blog">
                <?php if ($params->get('access-edit') || $params->get('show_print_icon') || $params->get('show_email_icon')) : ?>
                <ul class="actions">
                    <?php if (!$this->print) : ?>
                    <?php if ($params->get('show_print_icon')) : ?>
                        <li class="print-icon">
                            <?php echo JHtml::_('icon.print_popup', $this->item, $params); ?>
                        </li>
                        <?php endif; ?>

                    <?php if ($params->get('show_email_icon')) : ?>
                        <li class="email-icon">
                            <?php echo JHtml::_('icon.email', $this->item, $params); ?>
                        </li>
                        <?php endif; ?>
                    <?php if ($this->user->authorise('core.edit', 'com_content.article.' . $this->item->id)) : ?>
                        <li class="edit-icon">
                            <?php echo JHtml::_('icon.edit', $this->item, $params); ?>
                        </li>
                        <?php endif; ?>
                    <?php else : ?>
                    <li>
                        <?php echo JHtml::_('icon.print_screen', $this->item, $params); ?>
                    </li>
                    <?php endif; ?>
                </ul>
                <?php endif; ?>

                <dl class="article-info">
                    <dd class="published">
                        <?php echo JText::sprintf('COM_CONTENT_PUBLISHED_DATE_ON', JHtml::_('date', $this->item->publish_up, JText::_('DATE_FORMAT_LC2'))); ?>
                    </dd>
                    <dd class="createdby">
                        <?php $author = $this->item->author; ?>
                        <?php $author = ($this->item->created_by_alias ? $this->item->created_by_alias : $author);?>

                        <?php if (!empty($this->item->contactid) && $params->get('link_author') == true): ?>
                        <?php     echo JText::sprintf('COM_CONTENT_WRITTEN_BY',
                            JHtml::_('link', JRoute::_('index.php?option=com_contact&view=contact&id=' . $this->item->contactid), $author)); ?>

                        <?php else : ?>
                        <?php echo JText::sprintf('COM_CONTENT_WRITTEN_BY', $author); ?>
                        <?php endif; ?>
                    </dd>
                    <dd class="hits">
                        <?php echo JText::sprintf('COM_CONTENT_ARTICLE_HITS', $this->item->hits); ?>
                    </dd>
                </dl>
            </div>
        </div>
    </div>
    <?php if ($params->get('access-view')): ?>
    <?php echo $this->item->introtext; ?>
    <?php endif; ?>
</div>